package com.wm.reggie.common;/**
 * @author zqx
 * @since 2024/1/22
 */

/**
 * @author zqx
 * @since
 * 通过同一个线程来获取id，把id存到线程里，为了自动填充获取的值
 */
public class BaseContext {
    private static ThreadLocal<Long> threadLocal = new ThreadLocal<>();

    public static void setCurrentId(Long id){
        threadLocal.set(id);
    }

    public static Long getCurrentId(){
        return threadLocal.get();
    }
}
